import React from 'react';
import App from "@/App";
import AppLayout from "@/platform/layouts/AppLayout";
import { RouteConfigType } from '@/platform/types/route-config-type';
import LoadComponentUtil from '@/platform/commons/utils/load-component-util';
import appRoutes from "@/platform/routers/app-routers";

const routes: RouteConfigType[] = [
    {
        component: App as React.FC,
        routes: [
            {
                path: '/app',
                meta: {
                    title: '主页'
                },
                component: AppLayout as React.FC,
                routes: appRoutes
            }, {
                path: '/login',
                exact: true,
                meta: {
                    title: '登录'
                },
                component: LoadComponentUtil.load(import(/* webpackChunkName: "Login" */ '@/platform/views/login/Login'))
            }, {
                path: '*',
                meta: {
                    title: '404'
                },
                component: LoadComponentUtil.load(import(/* webpackChunkName: "NotFound" */ '@/platform/views/error-page/NotFound')),
                extraProps: {
                    toHomeVisible: false
                }
            }
        ]
    }
];

export default routes;
